From 128fb33d1bdf485fc1641e81deb6d87b589a7f7a Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Fri, 17 Jun 2005 08:47:00 +0000 Subject: [PATCH] bitkeeper revision 1.1713.3.1 (42b28e04xelbNlMIz5vWQQ5_M71w0A) privcmd.h, privcmd.c: Add IOCTL_PRIVCMD_INITDOMAIN_STORE to setup dom0 xenstore page and event channel. From: Rusty Russell Signed-off-by: Christian Limpach --- .../drivers/xen/privcmd/privcmd.c | 30 +++++++++++++++++++ .../include/asm-xen/linux-public/privcmd.h | 2 ++ 2 files changed, 32 insertions(+) diff --git a/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c index 2f9d5fde38..9eea1835b5 100644 --- a/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -196,6 +196,36 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, } break; + case IOCTL_PRIVCMD_INITDOMAIN_STORE: + { + extern int do_xenbus_probe(void*); + + if (xen_start_info.store_evtchn != 0) { + ret = -EINVAL; + break; + } + + /* Allocate page. */ + xen_start_info.store_page = get_zeroed_page(GFP_KERNEL); + if (!xen_start_info.store_page) { + ret = -ENOMEM; + break; + } + + /* We don't refcnt properly, so set reserved on page. + * (this allocation is permanent) */ + SetPageReserved(virt_to_page(xen_start_info.store_page)); + + /* Initial connect. Setup channel and page. */ + xen_start_info.store_evtchn = data; + ret = pfn_to_mfn(virt_to_phys((void *)xen_start_info.store_page) >> + PAGE_SHIFT); + + /* We'll return then this will wait for daemon to answer */ + // kthread_run(do_xenbus_probe, NULL, "xenbus_probe"); + } + break; + default: ret = -EINVAL; break; diff --git a/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h b/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h index 9142c6b35d..51d1ce5acf 100644 --- a/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h +++ b/linux-2.6.11-xen-sparse/include/asm-xen/linux-public/privcmd.h @@ -84,5 +84,7 @@ typedef struct privcmd_blkmsg _IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t)) #define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \ _IOC(_IOC_READ, 'P', 4, sizeof(unsigned long)) +#define IOCTL_PRIVCMD_INITDOMAIN_STORE \ + _IOC(_IOC_READ, 'P', 5, 0) #endif /* __PRIVCMD_H__ */ -- 2.30.2